package starblaze 
{
  import starblaze.error.MissingConstantError;
	
  public final class ConstantLookup 
  {
    
    internal var m_lut:Vector.<Constant> = new Vector.<Constant>();
    
    public function getIndex(constant:Constant):uint
    {
      for (var i:uint = 0; i < m_lut.length; ++i)
        if (m_lut[i].name == constant.name)
          return i;
          
      throw new MissingConstantError(constant);
      return -1;
    }
    
  }

}